//returns unique elems in an array; credit: www.shamasis.net
Array.prototype.unique = function() {    var o = {}, i, l = this.length, r = [];    for(i=0; i<l;i+=1) o[this[i]] = this[i];    for(i in o) r.push(o[i]);    return r;};
var allCats = document.getElementsByClassName('cat');
var cats = [];
for(var i = 0; i < allCats.length; i++){
	cats[i] = allCats[i].innerHTML;
}
cats = cats.unique();
var whereToPut = document.getElementById('categories');
op = "";
for(i = 0; i < cats.length; i++){
	op += ('<a href="#" onclick="document.getElementsBy">' + cats[i] + '</a>');
}
whereToPut.innerHTML = op;